package io.terminus.paas.profiler.service.impl

import io.terminus.paas.profiler.registry.RegistryServiceRouter
import io.terminus.paas.profiler.service.EnvironmentInitService
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.stereotype.Service

/**
 * Created by gengrong on 16/4/27.
 */
@Service
class EnvironmentInitServiceImpl @Autowired constructor(
        private val registryServiceRouter: RegistryServiceRouter
) : EnvironmentInitService {

    override fun initEnvironment(registryAddress: String) {
        Thread(Runnable {
            registryServiceRouter.getRegistryServerSync(registryAddress)
        }).start()
    }
}